package com.my.text;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

import java.util.ArrayList;
import java.util.List;

@Controller
public class textBeanPostProcessor implements BeanPostProcessor {

    private final  static List benainfoliat=new ArrayList();
  private final  static List benainfoliat1=new ArrayList();

  @Override
  public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {


    return bean;
  }

  @Override
  public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {


     benainfoliat.add(bean.getClass().getName());
     benainfoliat1.add(beanName);

    return bean;
  }

  public static List getbenaInfo(){
    List mylist=new ArrayList<>();

    mylist.add(benainfoliat);
    mylist.add(benainfoliat1);
    return mylist;
  }
}
